Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Managing Bitmaps

QuickDraw 3D provides routines that you can use to dispose of the memory occupied by a bitmap and to determine the size of the memory occupied by a bitmap.

Q3Bitmap_Empty

You can use the Q3Bitmap_Empty function to release the memory occupied by a bitmap that was allocated by a previous call to some QuickDraw 3D routine.

TQ3Status Q3Bitmap_Empty (TQ3Bitmap *bitmap);
bitmap
A pointer to a bitmap obtained by a previous call to some QuickDraw 3D routine such as Q3Marker_GetData , Q3Marker_GetBitmap , Q3DrawContext_GetMask , or Q3ViewHints_GetMask .

DESCRIPTION

The Q3Bitmap_Empty function releases the memory occupied by the bitmap pointed to by the bitmap parameter; that memory must have been allocated by a previous call to some QuickDraw 3D routine (for example, Q3Marker_GetBitmap ). You should not call Q3Bitmap_Empty to deallocate bitmaps that you allocated yourself.

Q3Bitmap_GetImageSize

You can use the Q3Bitmap_GetImageSize function to determine how much memory is occupied by a bitmap of a particular size.

unsigned long Q3Bitmap_GetImageSize (
                     unsigned long width,
                     unsigned long height);
width
The width, in bits, of a bitmap.
height
The height of a bitmap.

DESCRIPTION

The Q3Bitmap_GetImageSize function returns, as its function result, the size, in bytes, of the smallest block of memory required to hold a bitmap having a width and height specified by the width and height parameters, respectively.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |